package com.example.mall.domain;

import java.util.Date;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.example.mall.util.CodeGenerateUtils;

import java.io.Serializable;

/**
 * <p>
 * 商品分类表
 * </p>
 *
 * @author whale
 * @since 2025-05-06
 */
@TableName("tb_categories")
public class Categories extends Model<Categories> {

    private static final long serialVersionUID = 1L;

    /**
     * 分类唯一标识
     */
    @TableId("category_id")
    private Long categoryId;
    /**
     * 父分类ID
     */
    @TableField("parent_id")
    private Long parentId;
    /**
     * 分类名称
     */
    private String name;
    /**
     * 分类描述
     */
    private String description;
    /**
     * 是否启用（0：禁用，1：启用）
     */
    @TableField("is_active")
    private Integer isActive;
    /**
     * 创建时间
     */
    @TableField("create_date")
    private Date createDate;
    /**
     * 更新时间
     */
    @TableField("upate_date")
    private Date upateDate;

    public Categories(){
        this.categoryId = Long.valueOf(CodeGenerateUtils.generateUniqueId());
    }

    public Long getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(Long categoryId) {
        this.categoryId = categoryId;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Integer getIsActive() {
        return isActive;
    }

    public void setIsActive(Integer isActive) {
        this.isActive = isActive;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public Date getUpateDate() {
        return upateDate;
    }

    public void setUpateDate(Date upateDate) {
        this.upateDate = upateDate;
    }

    @Override
    public String toString() {
        return "Categories{" +
        ", categoryId=" + categoryId +
        ", parentId=" + parentId +
        ", name=" + name +
        ", description=" + description +
        ", isActive=" + isActive +
        ", createDate=" + createDate +
        ", upateDate=" + upateDate +
        "}";
    }
}
